/*
 * virtual.cpp
 *
 *  Created on: Apr 23, 2013
 *      Author: filipe
 */
#include <stdio.h>
#include <stdlib.h>

class A
{
	public:
		virtual void teste(){ printf("class A\n"); }
};

class B : public A
{
	public:
		void teste(){ printf("class B\n"); }
};

void funcao(A a)
{
	a.teste();
}

int main(void)
{
	B b;
	funcao(b);

	return 0;
}

